package jus.aoo.tri.sort;
import java.util.Comparator;

import jus.aoo.tri.Tri;

public class MaximumSort extends Tri {

	@Override
	protected <T> T[] sort(T[] t, Comparator<T> c) {
		int l = t.length-1;
		T m;
		int indm = 0;
		for (int i = l; i >= 0; i--) {
			m=t[i];
			for (int j = i; j >= 0; j--) {
				if(c.compare(m, t[j])>=0){
					indm = j;
					m = t[j];
				}
			}
			swap(t, indm, i);
		}
		return t;
	}
	
	

}
